package org.sfx.control

import org.sfx.rich.Enrich._

import javafx.scene.layout.StackPane

class TabContent(tab: Tab) extends StackPane {
  if (tab.content != null) {
    this.getChildren().setAll(tab.content)
  }
  
  this.visibleProperty.bind(this.tab.selectedProperty)
  
  this.tab.contentProperty.addChangeListener { (observable, oldValue, newValue) =>
    if (newValue != null) {
      this.getChildren.setAll(newValue)
    }
  }
}
